package com.lhys.exception;

import com.lhys.common.ResultInfo;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * User: xiaoqi
 * Date: 2021/5/12
 * Time: 下午 15:51
 * Description: 自定义异常
 */
@Data
@AllArgsConstructor
public class CustomException extends Exception {
    private Integer code;
    private String message;

    public CustomException(ResultInfo resultInfo) {
        this.code = resultInfo.getCode();
        this.message = resultInfo.getMessage();
    }
}